Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Record locking in Progress
When you read records from a database table, Progress applies a level of locking to the record that you can control so that you can prevent conflicts where multiple users of the same data are trying to read or modify the same records at the same time. This locking doesn’t apply to temp-tables since they are strictly local to a single Progress session and never shared between sessions.
When you read records using a
FINDstatement, aFOR EACHblock, or theGETstatement on a query that isn’t being viewed in a browse, by default Progress reads each record with aSHARE-LOCK. TheSHARE-LOCKmeans that Progress marks the record in the database to indicate that your session is using it. Another user (and the general term user here and elsewhere means code in any type of OpenEdge session that is accessing data, whether it’s through an actual user interface or not) can also read the same record in the same way—that’s why this is called aSHARE-LOCK.You can also specify a keyword on your
FINDorFOR EACHstatement, or on theOPEN QUERYstatement for a query, to read records with a different lock level. If you intend to change a record, you can use theEXCLUSIVE-LOCKkeyword. This marks the record as being reserved for your session’s exclusive use where any changes are concerned, including deleting the record. If any other user has aSHARE-LOCKon the record, an attempt to read it with anEXCLUSIVE-LOCKfails. Thus, aSHARE-LOCKassures you that while others can read the same record you have read, they cannot change it out from under you.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |